Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TEST_SPEED.cfg #120

Merged
merged 3 commits into from
Jul 5, 2024
Merged

Conversation

SuhbatDaRobot
Copy link
Contributor

Klipper no longer has a MAX_ACCEL_TO_DECEL paramter in the firmware, it has been changed to MINIMUM CRUISE RATIO.

This is a patch that works for now.

Klipper no longer has a MAX_ACCEL_TO_DECEL paramter in the firmware, it has been changed to MINIMUM CRUISE RATIO.

This is a patch that works for now.
Tested config, I don't know what the klipper internal parameter for minimum cruise ratio name is. Need to figure that out, this is working at he moment.
@mtaumike
Copy link

I was coming here to report the same

@anderso
Copy link

anderso commented Apr 24, 2024

There is an open issue as well: #119

This patch changes a lot of other stuff and there's commented out code. From briefly looking at this I'm not sure what the best solution is, I'm guessing there are no mechanisms to handle backward compatibility in klipper. Maybe setting and resetting both ACCEL_TO_DECEL and MIN_CRUISE_RATIO values should work for now? Or just assume people are using recent klipper and don't bother with ACCEL_TO_DECEL, or exit with error message if this is set in config.

In my case it errored with:

Error on 'SET_VELOCITY_LIMIT VELOCITY=200.0 ACCEL=5000.0 ACCEL_TO_DECEL=': unable to parse

Probably because printer.configfile.settings.printer.max_accel_to_decel has no value.

References:

https://www.klipper3d.org/Config_Reference.html#printer

https://www.klipper3d.org/Config_Changes.html?h=max_accel_to_decel#changes

@@ -63,49 +63,51 @@ gcode:
G0 X{x_min} Y{y_min} Z{bound + 10} F{speed*60}

# Set new limits
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} #MIN_CRUISE_RATIO = {0.5} #ACCEL_TO_DECEL={accel / 2}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} #MIN_CRUISE_RATIO = {0.5} #ACCEL_TO_DECEL={accel / 2}
SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} MINIMUM_CRUISE_RATIO=0

We want to disable the minimum cruise ratio, right? To ensure we actually move at the speed and accel that this macro wants.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right here. MIN_CRUISE_RATIO=0.5 is the default behavior which can lead to incorrect results in the test scenarios that use smaller shapes for testing. Therefore, MIN_CRUISE_RATIO=0 is the right piece of code to have here.

{% endfor %}

# Restore max speed/accel/accel_to_decel to their configured values
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} #MIN_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio} #ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} #MIN_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio} #ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel}
SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} MINIMUM_CRUISE_RATIO={printer.configfile.settings.printer.minimum_cruise_ratio}

And set it back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is correct as I have just set these parameters on my machine and they work fine.

Fixes proposed by jomik. This is working with settings being restored after testing.
@SuhbatDaRobot
Copy link
Contributor Author

There is an open issue as well: #119

This patch changes a lot of other stuff and there's commented out code. From briefly looking at this I'm not sure what the best solution is, I'm guessing there are no mechanisms to handle backward compatibility in klipper. Maybe setting and resetting both ACCEL_TO_DECEL and MIN_CRUISE_RATIO values should work for now? Or just assume people are using recent klipper and don't bother with ACCEL_TO_DECEL, or exit with error message if this is set in config.

In my case it errored with:

Error on 'SET_VELOCITY_LIMIT VELOCITY=200.0 ACCEL=5000.0 ACCEL_TO_DECEL=': unable to parse

Probably because printer.configfile.settings.printer.max_accel_to_decel has no value.

References:

https://www.klipper3d.org/Config_Reference.html#printer

https://www.klipper3d.org/Config_Changes.html?h=max_accel_to_decel#changes

There is an open issue as well: #119

This patch changes a lot of other stuff and there's commented out code. From briefly looking at this I'm not sure what the best solution is, I'm guessing there are no mechanisms to handle backward compatibility in klipper. Maybe setting and resetting both ACCEL_TO_DECEL and MIN_CRUISE_RATIO values should work for now? Or just assume people are using recent klipper and don't bother with ACCEL_TO_DECEL, or exit with error message if this is set in config.

In my case it errored with:

Error on 'SET_VELOCITY_LIMIT VELOCITY=200.0 ACCEL=5000.0 ACCEL_TO_DECEL=': unable to parse

Probably because printer.configfile.settings.printer.max_accel_to_decel has no value.

References:

https://www.klipper3d.org/Config_Reference.html#printer

https://www.klipper3d.org/Config_Changes.html?h=max_accel_to_decel#changes

The issues mentioned by the open issue fix have been fixed in this final commit thank to Jomik's suggestions. Thank you all for your help.

Copy link
Owner

@AndrewEllis93 AndrewEllis93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AndrewEllis93 AndrewEllis93 merged commit 3b198ca into AndrewEllis93:main Jul 5, 2024
@SuhbatDaRobot SuhbatDaRobot deleted the patch-1 branch July 6, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants